A computing device may execute various applications to interact with users of the computing device and to manipulate various data, which may be provided or specified by the user. At a low level, applications are made up of instructions that are executed by a processor in the computing device. When executed, each instruction causes the processor to perform a discrete function. Many such functions involve manipulation of data that is stored in some form of memory, such as a storage device (e.g., a hard disk drive or optical storage device), random access memory (RAM) of some form, cache memory, or registers within or associated with the processor. Areas of memory may be allocated for use for a particular function or by a particular application, and such areas of memory may be referred to as a “buffer.” A buffer that is used by multiple applications or for more than one function may be referred to as a “shared buffer.”
One example of a shared buffer is a frame buffer that is used by a computing device to display graphical information on a corresponding display screen. Each pixel in the display screen may correspond to a portion of the frame buffer. For example, a frame buffer may reserve four bytes of data for each pixel in the display screen. The address of each four-byte block in the frame buffer may correspond to a physical location of a specific pixel in the display screen. To display information on the display screen, the computing device may first fill the frame buffer with values that specify, for example, color and intensity values for each pixel. Subsequently, a graphics controller may control the pixels in the display screen according to the values in the frame buffer. To “refresh” the display screen, the computing device may fill the frame buffer with new values.
The frame buffer may be “shared” in the sense that more than one application may read values from or write values to the frame buffer, in order to display information on the display screen. For example, a computing device that runs an operating system, such as a version of Mac OS, available from Apple Computer, Inc., may display “windows” corresponding to a number of different applications. Applications corresponding to each window may control a portion of the frame buffer that corresponds to the position of the display screen that is occupied by the window. As an application updates information that is to be displayed in a corresponding window, or as the window is resized or moved by a user, a corresponding portion of the frame buffer may be updated. If multiple applications are running, multiple portions of the frame buffer may be updated simultaneously or substantially close in time.
The format of data in a shared buffer may be different than the format of data natively processed by the various applications. For example, in the context of the frame buffer described above, a graphics card associated with the display screen may be designed to receive data from the frame buffer in four-byte words for each pixel in the display screen. However, an application that has an active window on the display screen, and that writes to the frame buffer, may only supply one byte of data for each pixel. As another example, two applications that store data in a shared buffer may each process the data in a different order. More particularly, a first application may process data in four-byte words having a little endian format while a second application may process data in a big endian format.